Many computer programs begin as source code, which is relatively easy for human readers to understand and modify in comparison with lower level code such as intermediate language codes, byte codes, assembly codes, and machine language codes. Computer program source code is written and edited using text editors, version control systems, and other tools. Lower level codes are generated from source code, and/or from other lower level codes, using tools such as compilers, interpreters, linkers, and optimizers.
Some binary rewriters are tools that can be used to optimize binary codes by removing duplicate instructions, removing unreachable instructions, and removing duplicate data, for example. Binary rewriters do not make use of source code, but instead take lower level code as input and produce lower level code as output. In addition to their uses for optimization, binary rewriters have been used to insert security codes into binary executable code, to insert program instrumentation for performance profiling, and to obfuscate binary code in order to help protect confidential information about the code's structure and operations. The changes made in binary files by a binary rewriter are sometimes referred to as transformations, mutations, and/or optimizations, for example. Changes which do not produce functionally equivalent binary code are generally treated as errors in the binary rewriting process.